<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        html {
            margin: 0 auto;
        }



        .one {
            width: 100%;
            background-color: red;
        }

        .one:before,
        .one:after {
            content: "";
            display: table;
        }

        .one:after {
            clear: both;
        }

        /* ie6 7 专门清除浮动的样式*/
        .one {
            *zoom: 1;
        }

        .w1 {
            width: 22%;
            height: 200px;
            background-color: green;
            margin-right: 10px;
        }

        .one>div {
            float: left;
        }

        @media screen and (max-width: 769px) {
            body>.one {
                width: 100% !important;
            }

            body .one>.w1 {
                width: 33%;
            }
        }
        @media screen and (max-width: 560px) {
            body>.one {
                width: 80% !important;
            }

            body .one>.w1 {
                width: 50%;
            }
        }
        @media screen and (max-width: 460px) {
            body>.one {
                width: 100% !important;
            }

            body .one>.w1 {
                width: 100%;
            }
        }
    </style>
</head>

<body>
    <div class="one">
        <div class="w1">1</div>
        <div class="w1">1</div>
        <div class="w1">1</div>
        <div class="w1">1</div>
    </div>

</body>

</html>